Skip to content

feat: Take dependencies into account when sorting environment variables#1249

Open
siegfriedweber wants to merge 13 commits into
mainfrom
fix/env-var-order
Open

feat: Take dependencies into account when sorting environment variables#1249
siegfriedweber wants to merge 13 commits into
mainfrom
fix/env-var-order

Conversation

@siegfriedweber

@siegfriedweber siegfriedweber commented Jul 14, 2026

Copy link
Copy Markdown
Member

Description

Take dependencies into account when sorting environment variables

For example, the environment variables

ENV1=reference to $(ENV2)
ENV2=some value
ENV3=some value

are sorted in this order when iterated or converted to a vector:

ENV2
ENV1
ENV3

Part of stackabletech/issues#866

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added

@siegfriedweber siegfriedweber self-assigned this Jul 14, 2026
@siegfriedweber siegfriedweber moved this to Development: Waiting for Review in Stackable Engineering Jul 15, 2026
@siegfriedweber
siegfriedweber marked this pull request as ready for review July 15, 2026 11:50
NickLarsenNZ
NickLarsenNZ previously approved these changes Jul 15, 2026

@NickLarsenNZ NickLarsenNZ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but left a comment to check my understanding.

Comment thread crates/stackable-operator/src/v2/builder/pod/container.rs
@NickLarsenNZ NickLarsenNZ moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Jul 15, 2026
Comment thread crates/stackable-operator/src/v2/builder/pod/container.rs Outdated
Comment thread crates/stackable-operator/src/v2/builder/pod/container.rs Outdated
Comment thread crates/stackable-operator/src/v2/builder/pod/container.rs
Comment thread crates/stackable-operator/src/v2/builder/pod/container.rs Outdated
Techassi
Techassi previously approved these changes Jul 20, 2026

@Techassi Techassi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a minor (2-part) suggestion.

Comment thread crates/stackable-operator/src/v2/builder/pod/container.rs
Comment on lines +214 to +218
Vec::from(&self)
.into_iter()
.cloned()
.collect::<Vec<_>>()
.into_iter()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the suggestion above, this can be shortened into:

Suggested change
Vec::from(&self)
.into_iter()
.cloned()
.collect::<Vec<_>>()
.into_iter()
Vec::from(self).into_iter()

@siegfriedweber siegfriedweber Jul 20, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your suggestions introduced a call cycle between From<EnvVarSet> for Vec<EnvVar> and IntoIterator for EnvVarSet. I fixed it in de636c0, but the code is not shorter than before.

Co-authored-by: Techassi <git@techassi.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

3 participants